package com.fastshop.backup.dao.impl;

import java.util.HashSet;
import java.util.Set;

import org.springframework.stereotype.Component;

import com.fastshop.backup.dao.IAdminDao;
import com.fastshop.backup.entity.Admin;
import com.fastshop.backup.entity.Role;
import com.fastshop.common.impl.BaseDao;

/**
 * 标题、简要说明. <br>
 * 类详细说明.
 * <p>
 * Copyright: Copyright (c) 2013-4-12 下午1:51:04
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * 
 * @author wangpz@c-platform.com
 * @version 1.0.0
 */
@Component("adminDao")
public class AdminDao extends BaseDao<Admin, String> implements IAdminDao {

	@Override
	public boolean isExistByUserName(String username) {
		return false;
	}

	@Override
	public Admin getAdminByUserName(String userName) {
		Admin admin = new Admin();
		admin.setUserName("name");
		admin.setIsAccountEnabled(true);
		admin.setIsAccountExpired(false);
		admin.setIsAccountLocked(false);
		admin.setIsCredentialsExpired(false);
		Set<Role> roleSet = new HashSet<Role>();
		Role role = new Role();
		role.setValue("ROLE_ADMIN");
		roleSet.add(role);
		admin.setRoleSet(roleSet);
		return admin;
	}
}
